package gob.osinerg.emergencia.tag;

import org.apache.commons.lang.StringUtils;



public class TextFieldControl extends GenericControl{
	
	

	public TextFieldControl() {
		setType("text");
		setControl("input");
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<td width=\"25%\" height=\"25\" style=\"padding-bottom: 10px\">");
		sb.append(StringUtils.isEmpty(getLabel())?"":getLabel());
		sb.append("</td>");
		sb.append("<td>");
		openTag(sb);
		sb = getHtml(sb);
		closeTag(sb);
		sb.append(StringUtils.isEmpty(getRequired())?"":"(*)");
		sb.append("</td>");
		return sb.toString();
	}
	
	
	public static void main(String[] args) {
		
		TextFieldControl tfc = new TextFieldControl();
		tfc.setName("nombre");
		tfc.setOnkeyup("isNumeric(this)");
		System.out.println(tfc.toString());
		
	}

}
